<?php
/*
 +----------------------------------------------------------------------
 + Title        : UserController 控制器
 + Author       : Randy_chen
 + Version      : V1.0.0.1
 + Initial-Time : 2022/2/22 6:30
 + Last-time    : 2022/2/22 6:30+ chen2
 + Desc         : UserController
 +----------------------------------------------------------------------
*/


namespace app\api\controller;

use app\attributes\Validate;
use app\common\service\UserService;
use app\common\validate\UserValidate;
use think\App;

class UserController extends ApiBaseController
{
    public function __construct(App $app)
    {
        parent::__construct($app);
        if($app->request->param('user_id') != get_client_id()){
            error_abort('无此数据权限');
        }

    }

    /**
     * 更新用户信息 , 更新用户的昵称,头像,手机号
     * @author : Randy_chen
     * @Date   : 2022/2/22
     * @Time   : 6:30
     */
    #[Validate(validate: UserValidate::class, scene: 'updateFansItem')]
    public function updateFansItem() : \think\response\Json
    {
        $params = $this->getParams();
        $res = UserService::updateFansItem($params);
        return $this->returnSuccess($res);
    }
}